/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package procrastinator.table;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.table.DefaultTableCellRenderer;

/**
 *
 * @author alex
 */
public class DateRenderer extends DefaultTableCellRenderer {
    private DateFormat format;
    
    public DateRenderer() {
        super();
        
        format = new SimpleDateFormat("dd/MM/yy, HH:mm");
    }
    
    public void setValue(Object value) {
      if ((value != null) && (value instanceof Date)) {
          value = format.format((Date) value);
      } 
      
      super.setValue(value);
    } 
}
